import unittest
from unittest import TextTestRunner
from testcases.test_01user import TestUser
from util.log import log
from BeautifulReport import  BeautifulReport

def suit():
    suite = unittest.TestSuite()


    loader = unittest.TestLoader()

    load1 = loader.discover('testcases',pattern='test_01*.py')
    load_class1 = loader.loadTestsFromTestCase(TestUser)

    suite.addTests(load1)
    return suite

if __name__ == "__main__":
    log.info('运行开始')
    suite = suit()
    result = BeautifulReport(suite)
    result.report(filename="cnode",description="社区自动化测试报告")
    # zip file
    # 发送邮件

